package org.tloss.web.editor.editors.configuration;

import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

public class PropertyLabelProvider extends LabelProvider implements
		ITableLabelProvider {

	@Override
	public Image getColumnImage(Object element, int columnIndex) {

		return null;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String getColumnText(Object element, int columnIndex) {

		if (element != null && element instanceof Entry) {
			Entry config = (Entry) element;
			switch (columnIndex) {
			case 0:
				return config.getKey() != null ? config.getKey().toString()
						: "";
			case 1:
				return config.getValue() != null ? config.getValue().toString()
						: "";

			}
		}
		return "";
	}

}
